﻿<%@ Page Language="C#" MasterPageFile="~/Management.master" AutoEventWireup="true" CodeFile="EquipmentDisplay.aspx.cs" Inherits="EquipmentDisplay"%>
<%@ Register Assembly="EclipseWebSolutions.DatePicker" Namespace="EclipseWebSolutions.DatePicker"
    TagPrefix="ews" %>
<%@ Register Assembly="EeekSoft.Web.PopupWin" Namespace="EeekSoft.Web" TagPrefix="cc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc2" %>

<asp:Content ContentPlaceHolderID="m_contentBody" Runat="Server">

    <body>
    
         <asp:TextBox ID="txtHiddenEquipmentId" runat="server" Height="100%" Width="100%" 
            Visible="False"> 
            
         </asp:TextBox>                          
    <div id="containerright" class="containerright">
          <div id="TabbedPanels1" class="TabbedPanels">
                <ul class="TabbedPanelsTabGroup">
                  <li class="TabbedPanelsTab" tabindex="0">List Equipments</li>
                  <li class="TabbedPanelsTab" tabindex="1">Purchase Information</li>
                  <li class="TabbedPanelsTab" tabindex="2">Other Information</li>
                  
                   <li class="TabbedPanelsTab" tabindex="4">PC Sparepart Information</li>
                </ul>
              <div class="TabbedPanelsContentGroup" >

                  <div class="TabbedPanelsContent">
                   

<table  class="GridItem" cellspacing="2" cellpadding="2" style="width:auto;height:350">
    <tr>
        <td class="BigLabel" >
            <asp:Label Width="100%" Height="100%" ID="lblTotalEquipment" runat="server" Text="Label"></asp:Label><asp:Label ID="lblMessageValidate" runat="server" CssClass="permissionstyle"></asp:Label><asp:Label ID="lblpermissiondelete" runat="server" CssClass="permissionstyle"></asp:Label>
            
       <%-- width="100%" Height="300px" --%>
        </td>
        </tr>
        
  <tr>
  <td  align="center" class="GridItem"  style="text-align:center">
             
                 <asp:ObjectDataSource ID="dsMessage" runat="server" SelectMethod="GetMessage" 
                     TypeName="DirectService"></asp:ObjectDataSource>
             <br />
             </td>    
         </tr>          
 <tr><td>
<div style=" height:350px; width:auto; overflow:auto">
      <asp:GridView
         
            ID="grdEquipment" 
            runat="server" 
            AllowPaging="True" 
            AutoGenerateColumns="False" 
            OnPageIndexChanging="grdEquipment_PageIndexChanging" 
            AllowSorting="True" 
            onrowcancelingedit="grdEquipment_RowCancelingEdit" 
            onrowdatabound="grdEquipment_RowDataBound1" 
            DataSourceID="odsEquipment" 
            RowHeaderColumn="EquipmentId" CssClass="GridItem" BorderStyle="None" 
            onselectedindexchanged="grdEquipment_SelectedIndexChanged" 
            DataKeyNames="EquipmentId" onrowcommand="grdEquipment_RowCommand1">
                <HeaderStyle BorderStyle="None" CssClass="GridViewHeader" Height="30px" />
                    <Columns>
                        <asp:CommandField ShowSelectButton="True" >
                            <ItemStyle Width="30px" />
                        </asp:CommandField>
                        <%--<asp:TemplateField>
                            <ItemTemplate>
                
                                <a href="EquipmentDisplay.aspx?detail=false&tabIndex=1&equipmentId=<%# DataBinder.Eval(Container.DataItem, "EquipmentId") %>&codeNumber=<%# DataBinder.Eval(Container.DataItem, "CodeNumber") %>&pageIndex=<%=GetPageIndex()%>&purchaseDate=<%# DataBinder.Eval(Container.DataItem, "PurchaseDate") %>""> 
                                    <img border=0 src="./images/b_view.png" width="20" height="20">
                                </a> 
                            </ItemTemplate>
                            <ItemStyle Width="15px" />
                        </asp:TemplateField>--%>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <a href="javascript:confirmDelete('EquipmentDisplay.aspx?delete=true&tabIndex=0&equipmentId=<%# DataBinder.Eval(Container.DataItem, "EquipmentId")%>&pageIndex=<%=GetPageIndex()%>')">
                                    <img border="0" src="./images/del.png" width="15" height="15" >
                                </a>
             
                            </ItemTemplate>
                            <ItemStyle Width="15px" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="EquipmentId" HeaderText="EquipmentId" 
                Visible="False">
                <ItemStyle Width="50px" />
            </asp:BoundField>
            <asp:BoundField DataField="CodeNumber" HeaderText="Code" SortExpression="CodeNumber">
                <ItemStyle Width="50px" />
            </asp:BoundField>
            <asp:BoundField HeaderText="System" DataField="System" SortExpression="System">
                <ItemStyle Width="60px" />
            </asp:BoundField>
            <asp:BoundField HeaderText="Type" DataField="TYPEEQUIPMENT" SortExpression="TYPEEQUIPMENT" >
                <ItemStyle Width="130px" />
            </asp:BoundField>
            <asp:BoundField DataField="Model" HeaderText="Model" SortExpression="Model" >
                <ItemStyle Width="130px" />
            </asp:BoundField>
            <asp:BoundField HeaderText="Purchase company" DataField="COMPANYNAME" 
                            SortExpression="COMPANYNAME">
                <ItemStyle Width="150px" />
            </asp:BoundField>
            <asp:BoundField HeaderText="Purchase date" DataField="PurchaseDate" 
                DataFormatString="{0:MM/dd/yyyy}" HtmlEncode="False" SortExpression="PurchaseDate">
                <ItemStyle Width="70px" />
            </asp:BoundField>
            <asp:BoundField HeaderText="Employee" DataField="EmployeeName" 
                            SortExpression="EmployeeName">
                <ItemStyle Width="130px" />
            </asp:BoundField>
            
        </Columns>
        <PagerStyle HorizontalAlign="Center" 
            VerticalAlign="Middle" />
        <EditRowStyle BackColor="LightGray" />
        <RowStyle CssClass="AlternativeRowStyle" />
        <AlternatingRowStyle BackColor="White" CssClass="AlternativeRowStyle" />
    </asp:GridView>
</div>
        </td>
    </tr>
    <tr>
        <td align="center" class="GridItem" >      
            <asp:UpdatePanel ID="updatePanelEquipment" runat="server">
            <ContentTemplate>
        
                <asp:ObjectDataSource ID="odsEquipment" runat="server" 
                    SelectMethod="GetEquipementDisplayed" TypeName="DirectService" 
                     OnSelected="odsEquipment_Selected">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="txtHiddenWhereClause" Name="whereClause" 
                            PropertyName="Text" Type="String" />
                        <asp:Parameter Name="orderbyClause" Type="String" />
                    </SelectParameters>
                </asp:ObjectDataSource>
    <tr><td>
    <asp:TextBox ID="txtHiddenPageIndex" runat="server" Visible="False"></asp:TextBox>
    <a id="detailPosition"></a>
       <asp:TextBox ID="txtHiddenWhereClause" runat="server" Height="17px" Width="205px" Visible="False"></asp:TextBox>
       <asp:TextBox ID="txthiddenOrderbyClause" runat="server"  Width="77px" 
            Visible="False"></asp:TextBox>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="txtHiddenWhereClause" EventName="TextChanged" />
                
            </Triggers>
            <Triggers>
            <asp:AsyncPostBackTrigger ControlID="txthiddenOrderbyClause" EventName="TextChanged" />
            </Triggers>
        	    </ContentTemplate>
        	    </asp:UpdatePanel>
         </td></tr>    
    </table>
    
          </div>
                              
                <div class="TabbedPanelsContent" >
                        <iframe  class="FrameDimension" src="EquipmentModify.aspx?displayMode=<%=GetDisplayMode()%>&equipmentId=<%=txtHiddenEquipmentId.Text%>"  frameborder="0" ></iframe></div><!--This content will be included not use Iframe when using dynamique programing-->
                  
                  <div class="TabbedPanelsContent">
                        <iframe class="FrameDimension" src="EquipOtherInformationModify.aspx?displayMode=<%=GetDisplayMode()%>&equipmentId=<%=txtHiddenEquipmentId.Text%>" frameborder="0" ></iframe></div>
                 
                 
                 <div class="TabbedPanelsContent">
                        <iframe class="FrameDimension" src="pcSparepartAdd.aspx?<%=GetAttachedParameters()%>" frameborder="0"></iframe>
                 </div> 
          </div>
    </div>
 </div>
 
  </body>
 <script type="text/javascript">
    var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
    
 </script>

 
             <asp:GridView ID="grdGroupeSoftware1" runat="server" 
        AllowPaging="True" Width="750px" 
                     AutoGenerateColumns="False"  Visible ="False" DataSourceID="dsMessage" 
                     
                     CellPadding="4" ForeColor="#333333" GridLines="None" 
        onselectedindexchanged="grdGroupeSoftware1_SelectedIndexChanged">
                 <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                 <RowStyle BackColor="#EFF3FB" />
                 <Columns>
                     <asp:BoundField DataField="Label" />
                 </Columns>
             
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                   <RowStyle BackColor="#EFF3FB" />
                   <SelectedRowStyle BackColor="#FF5050" />
                   <HeaderStyle BorderStyle="None" CssClass="GridViewHeader" Height="20px" 
                        Width="30px" />
                        
                    <PagerStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    <EditRowStyle BackColor="LightGray" />
                    <RowStyle CssClass="AlternativeRowStyle" />
                    <AlternatingRowStyle BackColor="White" CssClass="AlternativeRowStyle" />
                    
                 
             </asp:GridView >
             
                 </asp:Content>

<asp:Content ID="Content1" runat="server" contentplaceholderid="conSearch">
    &nbsp;

            <div class="AccordionPanel">
        	    <div class="AccordionPanelTab"><asp:ImageButton ID="btnIndicator" runat="server" ImageUrl="~/images/indicator.png" />&nbsp;<b class="contentcolor">EQUIPMENT</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
        	    <div class="AccordionPanelContent">
        	      <div>Code Nº: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;PO Nº &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </div>
        	      <div style="height:30px"><asp:TextBox ID="txtCodeNumber" runat="server" Height="17px" 
                          Width="81px"></asp:TextBox>&nbsp;&nbsp;<asp:TextBox ID="txtPONumber" 
                          runat="server" Height="17px" 
                          Width="79px"></asp:TextBox><br /></div>
                    <div style="height:30px"> Delivery date:
                                <asp:TextBox ID="txtPurchaseDate" runat="server" Width="80px"></asp:TextBox>
            <asp:Image ID="imgCalendar" runat="server" ImageUrl="~/images/calendar.png" />
            <cc2:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="txtPurchaseDate" PopupButtonID="imgCalendar">
            </cc2:CalendarExtender> 
                                </div>
                                  <div style="height:30px">Warranty date:
                                <asp:TextBox ID="txtEndWarrantyDate" runat="server" Width="71px"></asp:TextBox>
            <asp:Image ID="Image1" runat="server" ImageUrl="~/images/calendar.png" />
            <cc2:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtEndWarrantyDate" PopupButtonID="Image1">
            </cc2:CalendarExtender> 
                                </div>
                     
                                
                    <div style="height:40px">
                    
                        &nbsp;System : 
                       <asp:UpdatePanel ID="updatePanel1" runat="server"><ContentTemplate>
                        <asp:DropDownList ID="drlSystem" runat="server" Height="20px" 
                          Width="195px" AppendDataBoundItems="True" DataSourceID="odsSystem" 
                          DataTextField="SystemLabel" DataValueField="SystemId" AutoPostBack="True">
                                    <asp:ListItem Value="-1">--- Choose a system ---</asp:ListItem>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="odsSystem" runat="server" 
                          SelectMethod="GetSystems" TypeName="Service.ReferenceDataService">
                        </asp:ObjectDataSource>
                      </ContentTemplate> </asp:UpdatePanel>
                       
                                </div>
                                <div style="height:40px">
                        &nbsp;Equipment type: &nbsp;
                    <asp:UpdatePanel ID="updatePanel2" runat="server"><ContentTemplate>
                        <asp:DropDownList ID="drlEquipmentType" runat="server" Height="20px" 
                          Width="195px" AppendDataBoundItems="True" DataSourceID="odsEquipmentType" 
                          DataTextField="typeequipment" DataValueField="typeequipementid" AutoPostBack="True" 
                          >
                                        <asp:ListItem Value="-1">--- Choose an equipment type ---</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:ObjectDataSource ID="odsEquipmentType" runat="server" 
                          SelectMethod="GetEquipmentSystemEquipmentType" TypeName="ReferenceDataDirectService" 
                                        >
                                        <SelectParameters>
                                            <asp:ControlParameter ControlID="drlSystem" Name="systemId" 
                                                PropertyName="SelectedValue" Type="Int32" />
                                        </SelectParameters>
                                    </asp:ObjectDataSource>
                    </ContentTemplate> </asp:UpdatePanel>
                                </div>
                                <div style="height: 40px">
                     &nbsp;Model : &nbsp;
                     <asp:UpdatePanel ID="updatePanel3" runat="server"><ContentTemplate>
                     <asp:DropDownList ID="drlModel" runat="server" Height="20px" 
                          Width="195px" AppendDataBoundItems="True" DataSourceID="odsEquipmentModel" 
                          DataTextField="Model" DataValueField="ModelId">
                                    <asp:ListItem Value="-1">--- Choose a Model ---</asp:ListItem>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="odsEquipmentModel" runat="server" 
                          SelectMethod="GetModelByTypeEquipmentId" TypeName="ReferenceDataDirectService">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="drlEquipmentType" Name="typeId" 
                                    PropertyName="SelectedValue" Type="Int32" />
                            </SelectParameters>
                        </asp:ObjectDataSource>
                         </ContentTemplate> </asp:UpdatePanel>
                                &nbsp; 
                    </div>
                                <div style="height: 40px; width: 219px;">
                        &nbsp;Company : &nbsp;
                        <asp:UpdatePanel ID="updatePanel4" runat="server"><ContentTemplate>
<asp:DropDownList ID="drlCompany" runat="server" Height="20px" 
                          Width="195px" AppendDataBoundItems="True" DataSourceID="odsCompany" 
                          DataTextField="SupplierName" DataValueField="SupplierId">
                                    <asp:ListItem Value="-1">--- Choose a company ---</asp:ListItem>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="odsCompany" runat="server" 
                          SelectMethod="GetSuppliers" TypeName="Service.ReferenceDataService">
                        </asp:ObjectDataSource>
                         </ContentTemplate> </asp:UpdatePanel>
                    </div>
                    
                    <div style="height: 40px">
                        &nbsp;Owner : &nbsp;
                        <asp:UpdatePanel ID="updatePanel5" runat="server"><ContentTemplate>
<asp:DropDownList ID="drlUser" runat="server" Height="20px" 
                          Width="195px" AppendDataBoundItems="True" DataSourceID="odsEmployee" 
                          DataTextField="EmployeeName" DataValueField="EmployeeId">
                                    <asp:ListItem Value="-1">--- Choose an owner ---</asp:ListItem>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="odsEmployee" runat="server" 
                          SelectMethod="GetEmployees" TypeName="Service.ReferenceDataService">
                        </asp:ObjectDataSource>
                        
 </ContentTemplate> </asp:UpdatePanel>
                    </div>
                     <div style="height:40px">
                        &nbsp;Location : 
                        <asp:DropDownList ID="drlLocation" runat="server" Height="20px" 
                          Width="195px" AppendDataBoundItems="True" DataSourceID="odsLocation" 
                          DataTextField="LocationLabel" DataValueField="LocationId" AutoPostBack="True">
                                    <asp:ListItem Value="-1">--- Choose a location ---</asp:ListItem>
                        </asp:DropDownList>
                        
                         <asp:ObjectDataSource ID="odsLocation" runat="server" 
                             SelectMethod="GetLocations" TypeName="Service.ReferenceDataService">
                         </asp:ObjectDataSource>
                        
                        
                       
            
                                </div>
                                
                    <div>
                    
                    <asp:CheckBox ID="chkDamaged" Text="Damaged" runat="server" /> <br /> </div>
               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:Button  ID="btnSearch" 
                        runat="server" Height="25px" Text="Search" CssClass="btnexpress" 
        Width="71px" BorderStyle="Dotted" onclick="btnValidate_Click" />
            
        </div>
                <cc1:PopupWin ID="popupWin" runat="server" />
    </div>
    
  
</asp:Content>
    


